In [36]:
import pandas as pd
from matplotlib import pyplot as plt
%matplotlib notebook

In [2]:
def parse_and_plot(filename):
    df = pd.read_csv(filename,header=None)
    df /= float(1e6) # convert to milliseconds
    ax = df.plot(kind='hist', bins=50, figsize=(15,8))
    ax.set_title("Initial Diff Latency")
    ax.set_ylabel("Latency (ms)")
    ax = df.plot(kind='line',style='-',figsize=(15,8))
    ax.set_title("Initial Diff Latency")
    ax.set_ylabel("Latency (ms)")
    ax.set_xlabel("Sample #")
    return df

Forwarding Latency

It is being run from a desktop computer on the UC Berkeley network w/ avg ping latency of 5.03ms to a single broker running on EC2 running in standalone mode.

Pairs

10 pairs of pub/sub that share a query. Publishers at a rate of 10 msg/sec, runtime of 20 minutes. Each query has a unique key and value


In [ ]:
FILENAME="data/10_pub_sub_pairs.csv"
df = parse_and_plot(FILENAME)
df.describe()

100 pairs of pub/sub that share a query. Publishers at a rate of 10 msg/sec, runtime of 20 minutes. Each query has a unique key and value


In [3]:
filename="data/forwarding_latency_100pub_to_1sub.csv"
df = pd.read_csv(filename)
df /= float(1e6)
df.plot(kind='line', figsize=(15,8))


Out[3]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f434a711190>

In [15]:
filename="data/1_client_10_pub.csv"
df1 = pd.read_csv(filename, header=None)
df1 /= float(1e6)
df1.plot(style='-',figsize=(15,8))
print df1.quantile(q=.99)
df1.describe()


0    4.98007
dtype: float64
Out[15]:
0
count 30681.000000
mean 4.671935
std 0.550779
min 4.383656
25% 4.590678
50% 4.640270
75% 4.698337
max 53.796289

We wil run forwrdingLatencyNto1 for clients = 1, 10, 100. In the N > 1 case, we average the N clients together to get a single timeseries for that case, then we will plot them all together


In [17]:
filename="data/10_client_100_pub.csv"
df2 = pd.read_csv(filename, header=None)
df2 /= float(1e6)
df2[0] = df2.mean(axis=1)
print df2[0].quantile(q=.99)
df2[0].plot(style='-',figsize=(15,8))
#df2.describe()


5.783212584
Out[17]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f4346c90ed0>

In [18]:
df1[1] = df2[0]

In [20]:
filename="data/100_client_1000_pub.csv"
df3 = pd.read_csv(filename, header=None)
df3 /= float(1e6)
df3[0] = df3.mean(axis=1)
df3.plot(style='-',figsize=(15,8), legend=False)
print df3[0].quantile(q=.99)
df1[2] = df3[0]


396.850573892

In [39]:
snp = df1[df1 > 3.5].copy()
snp.columns = ['1:10 sub:pub','10:100 sub:pub', '100:1000 sub:pub']
axs = snp.plot(figsize=(15,10), subplots=True)
for ax in axs:
    ax.set_ylabel("Latency (ms)")
    ax.set_xlabel("Sample (5msg/sec)")
    ax.set_yscale('log')



In [14]:
df1


Out[14]:
0 2
0 7.671533 189.823977
1 7.543374 138.616185
2 7.618414 146.660451
3 4.536318 101.419100
4 7.593946 123.901802
5 4.774033 105.662474
6 7.477275 109.038301
7 7.457885 82.578035
8 4.587200 138.985343
9 4.570765 102.673500
10 4.560813 113.312531
11 4.602351 131.467739
12 7.645818 158.090043
13 4.517214 121.654411
14 4.704051 107.909165
15 4.537828 123.251430
16 4.633974 145.686894
17 7.806164 129.206377
18 4.726999 107.167948
19 4.557930 102.770642
20 4.601433 122.092910
21 7.541251 139.585611
22 4.600335 146.738403
23 4.544892 101.455533
24 7.619055 120.585189
25 4.548558 121.738704
26 4.639449 118.875973
27 4.594421 103.142257
28 4.648321 107.094678
29 4.585545 101.828117
... ... ...
59987 4.597975 4.727898
59988 4.558599 4.642775
59989 4.594606 4.735589
59990 4.550629 4.747549
59991 4.663295 4.703235
59992 4.558004 4.756628
59993 4.575303 4.803276
59994 4.519506 4.781756
59995 4.628230 4.691477
59996 4.539051 4.802417
59997 4.581275 5.894942
59998 4.661496 6.488956
59999 4.561259 6.366828
60000 4.575960 6.908447
60001 4.543539 4.873744
60002 4.578582 7.988698
60003 4.588036 5.824662
60004 4.524213 8.022866
60005 4.630177 6.024348
60006 4.624620 8.197034
60007 4.660529 6.150396
60008 4.687513 8.095633
60009 4.704333 6.049136
60010 4.764634 7.886560
60011 4.924131 5.896013
60012 4.798621 7.857786
60013 4.809412 5.832387
60014 4.586519 7.753297
60015 4.756974 5.900222
60016 4.956436 7.878497

60017 rows × 2 columns


In [ ]: